package com.ruoyi.system.service.impl;

import java.util.Date;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.GwHomeSummarizeMapper;
import com.ruoyi.system.domain.GwHomeSummarize;
import com.ruoyi.system.service.IGwHomeSummarizeService;

/**
 * 首页汇总Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-10-10
 */
@Service
public class GwHomeSummarizeServiceImpl implements IGwHomeSummarizeService 
{
    @Autowired
    private GwHomeSummarizeMapper gwHomeSummarizeMapper;

    /**
     * 查询首页汇总
     * 
     * @param homeId 首页汇总主键
     * @return 首页汇总
     */
    @Override
    public GwHomeSummarize selectGwHomeSummarizeByHomeId(Long homeId)
    {
        return gwHomeSummarizeMapper.selectGwHomeSummarizeByHomeId(homeId);
    }


    /**
     * 查询首页汇总列表
     * 
     * @param gwHomeSummarize 首页汇总
     * @return 首页汇总
     */
    @Override
    public List<GwHomeSummarize> selectGwHomeSummarizeList(GwHomeSummarize gwHomeSummarize)
    {
        return gwHomeSummarizeMapper.selectGwHomeSummarizeList(gwHomeSummarize);
    }

    /**
     * 新增首页汇总
     * 
     * @param gwHomeSummarize 首页汇总
     * @return 结果
     */
    @Override
    public int insertGwHomeSummarize(GwHomeSummarize gwHomeSummarize)
    {
        return gwHomeSummarizeMapper.insertGwHomeSummarize(gwHomeSummarize);
    }

    /**
     * 修改首页汇总
     * 
     * @param gwHomeSummarize 首页汇总
     * @return 结果
     */
    @Override
    public int updateGwHomeSummarize(GwHomeSummarize gwHomeSummarize)
    {
        gwHomeSummarize.setUpdateTime(DateUtils.getNowDate());
        return gwHomeSummarizeMapper.updateGwHomeSummarize(gwHomeSummarize);
    }

    /**
     * 批量删除首页汇总
     * 
     * @param homeIds 需要删除的首页汇总主键
     * @return 结果
     */
    @Override
    public int deleteGwHomeSummarizeByHomeIds(Long[] homeIds)
    {
        return gwHomeSummarizeMapper.deleteGwHomeSummarizeByHomeIds(homeIds);
    }

    /**
     * 删除首页汇总信息
     * 
     * @param homeId 首页汇总主键
     * @return 结果
     */
    @Override
    public int deleteGwHomeSummarizeByHomeId(Long homeId)
    {
        return gwHomeSummarizeMapper.deleteGwHomeSummarizeByHomeId(homeId);
    }
    /**
     * 获取首页汇总
     *
     * @param homeId 首页汇总主键
     * @return 结果
     */
    @Override
    public GwHomeSummarize selectGwHomeSummarizeAll(String nodeIdentifier) {
        return gwHomeSummarizeMapper.selectGwHomeSummarizeAll(nodeIdentifier);
    }
    /**
     * 通过节点标识表示查询首页数据
     *
     * @param NodeIdentifier 节点标识
     * @return 首页汇总
     */
    @Override
    public GwHomeSummarize selectGwHomeSummarizeByNodeIdentifier(String NodeIdentifier) {
        return gwHomeSummarizeMapper.selectGwHomeSummarizeByNodeIdentifier(NodeIdentifier);
    }

    @Override
    public void deleteGwHomeSummarizeByDeptId(Long deptId) {
        gwHomeSummarizeMapper.deleteGwHomeSummarizeByDeptId(deptId);
    }

    @Override
    public GwHomeSummarize selectGwHomeSummarizefindMonth(String nodeIdentifier, String month) {
        return  gwHomeSummarizeMapper.selectGwHomeSummarizefindMonth(nodeIdentifier, month);
    }

    @Override
    public   List<GwHomeSummarize> findAll1ByNodeIdentifierList(String nodeIdentifier, String startDate, String endDate) {


        List<GwHomeSummarize>  all1ByNodeIdentifierList = gwHomeSummarizeMapper.findAll1ByNodeIdentifierList(nodeIdentifier, startDate, endDate);

        return all1ByNodeIdentifierList;
    }
}
